package com.teemo.dp.flyweight.demo2;


import java.util.ArrayList;
import java.util.List;

/**
 * @author Teemo
 */
public class Demo {
    public static void main(String[] args) {
        PieceFactory pieceFactory = new PieceFactory();
        List<Position> positions = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Piece piece;
            if (i % 2 == 0) {
                piece = pieceFactory.getPiece("black");
            } else {
                piece = pieceFactory.getPiece("white");
            }
            Position position = new Position(piece, i, i);
            positions.add(position);
        }
        System.out.println(positions.size());
    }
}
